package com.room.search.service.dto.baidu;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;

/**
 * By   : ghd.bright
 * Time : 2022/3/23
 * Description: 调用百度API返回的公共参数
 */
public class BaiduApiResponse<T> implements Serializable {

    private Integer status;

    private String message;

    @JsonProperty("result_type")
    private String resultType;

    private T results;

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getResultType() {
        return resultType;
    }

    public void setResultType(String resultType) {
        this.resultType = resultType;
    }

    public T getResults() {
        return results;
    }

    public void setResults(T results) {
        this.results = results;
    }

    public boolean isSuccess() {
        return this.status == 0;
    }

    @Override
    public String toString() {
        return "BaiduApiResponse{" +
            "status=" + status +
            ", message='" + message + '\'' +
            ", resultType='" + resultType + '\'' +
            ", results=" + results +
            '}';
    }
}
